﻿using Huirui.Cavan.Domain.MainBoundedContext.SystemModule;
using Huirui.Cavan.Domain.Seedwork;
using System;
using System.Collections;

namespace Huirui.Cavan.Domain.MainBoundedContext.StockModule
{
    #region StockInOutType

    /// <summary>
    /// StockInOutType object for NHibernate mapped table 'StockInOutType'.
    /// </summary>
    [Serializable]
    public class StockInOutType : Persistent
    {
        #region Member Variables

        protected string _name;
        protected bool _isIn;
        protected Account _fromAccount;
        protected bool _isCostAccounting;
        protected Corporation _corporation;
        #endregion

        #region Constructors

        public StockInOutType() { }

        public StockInOutType(string name, bool isIn, Account fromAccount, bool isCostAccounting, DateTime createDate, DateTime modifyDate, int editUser, Corporation corporation)
        {
            this._name = name;
            this._isIn = isIn;
            this._fromAccount = fromAccount;
            this._isCostAccounting = isCostAccounting;
            this._createDate = createDate;
            this._modifyDate = modifyDate;
            this._editUser = editUser;
            this._corporation = corporation;
        }

        #endregion

        #region Public Properties

        public virtual string Name
        {
            get { return _name; }
            set
            {
                if (value != null && value.Length > 20)
                    throw new ArgumentOutOfRangeException("Invalid value for Name", value, value.ToString());
                _name = value;
            }
        }

        public virtual bool IsIn
        {
            get { return _isIn; }
            set { _isIn = value; }
        }

        public virtual Account FromAccount
        {
            get { return _fromAccount; }
            set
            {
                _fromAccount = value;
            }
        }

        public virtual bool IsCostAccounting
        {
            get { return _isCostAccounting; }
            set { _isCostAccounting = value; }
        }

        public virtual Corporation Corporation
        {
            get { return _corporation; }
            set { _corporation = value; }
        }

        #endregion
    }
    #endregion
}